From: Florian Müllner Date: Tue, 29 Jan 2019 21:43:41 +0000 (+0100) Subject: iconGrid: Fix nonsense condition X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~897^2^2~92 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=a7943ff9340480f2db0b91f7632ea1d882a9caed;p=gnome-shell.git iconGrid: Fix nonsense condition Just like the "in" operator in the previous patch, "instanceof" has a lower precedence than negation, resulting in the nonsense condition of "true instanceof BaseIcon". Add parentheses to get the intended behavior. Spotted by eslint. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/375 --- diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js index 6d6e2284f..cd54d50a3 100644 --- a/js/ui/iconGrid.js +++ b/js/ui/iconGrid.js @@ -670,7 +670,7 @@ var IconGrid = GObject.registerClass({ } addItem(item, index) { - if (!item.icon instanceof BaseIcon) + if (!(item.icon instanceof BaseIcon)) throw new Error('Only items with a BaseIcon icon property can be added to IconGrid'); this._items.push(item);